package org.qpcr.community.standalone.web.response.dashboard;

import java.util.Objects;

/**
 * 统计项对象（用于产品、设备、今日实验统计）
 */
public class StatItem {
    private String name;
    private Integer value;
    private String color;

    // 构造函数
    public StatItem() {}

    public StatItem(String name, Integer value, String color) {
        this.name = name;
        this.value = value;
        this.color = color;
    }

    // Getter 和 Setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StatItem statItem = (StatItem) o;
        return Objects.equals(name, statItem.name) &&
                Objects.equals(value, statItem.value) &&
                Objects.equals(color, statItem.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, value, color);
    }

    @Override
    public String toString() {
        return "StatItem{" +
                "name='" + name + '\'' +
                ", value=" + value +
                ", color='" + color + '\'' +
                '}';
    }
}